package com.ysd.lis.service.lab;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.yulichang.base.MPJBaseService;
import com.ysd.common.Result;
import com.ysd.lis.entity.lab.LabMaininfo;
import com.ysd.lis.entity.lab.LabReqMain;
import com.ysd.lis.request.LabMaininfoPageDto;
import com.ysd.lis.request.LabReqAdditionsDto;
import com.ysd.lis.request.PrintBarcodeDto;
import com.ysd.lis.request.lab.LabReqMainChangeWkflwParam;
import com.ysd.lis.request.lab.LabReqMainDto;
import com.ysd.lis.request.lab.LabReqMainReceptionParam;
import com.ysd.lis.request.lab.LabReqMainValidateTatRule;

import java.util.List;


/**
 * <p>
 * 检验申请主表 服务类
 * </p>
 *
 * @author HuiXing
 * @since 2023-12-26
 */
public interface LabReqMainService extends MPJBaseService<LabReqMain> {

    Result findLabReqMainPageList(LabMaininfoPageDto maininfoPageDto);

    Result getReqMainByReqNo(LabReqMain reqMain) throws JsonProcessingException;

    Result createSamplingDetail(LabReqMain reqMain) throws JsonProcessingException;

    Result createCollectionDetail(LabReqMain reqMain) throws JsonProcessingException;

    Result findLabReqMainPageListByState(LabMaininfoPageDto maininfoPageDto);

    Result findLabReqAdditions(String reqNo);

    Result findReqMainByReqNo(String reqNo);

    Result addReqAdditions(LabReqAdditionsDto labReqAdditionsDto);

    Result deleteReqAdditions(LabReqAdditionsDto labReqAdditionsDto);

    Result barcodePrintQuery(PrintBarcodeDto dto);

    Result findLabReqMainList(LabReqMainDto labReqMain);

    /*查询Tat申请信息*/
    Result findLabTatReqMainList(LabReqMainDto labReqMain);

    Result findMainList(LabReqMainDto labReqMain);

    Result findReqMainAndDetailList(LabReqMainDto labReqMain) throws JsonProcessingException;

    /*微生物标本签收计算选用的方案*/
    Boolean CalcWkflwCultures(LabReqMain entry, LabMaininfo labMaininfo);

    /*微生物标本签收*/
    Result bacReqReception(LabReqMainReceptionParam input);

    /*微生物不走签收、直接扫码上机处理检验目的*/
    Boolean bacCalcPurposeByScanReqNo(LabReqMain reqMain, LabMaininfo labMaininfo);

    /*微生物检验采用默认方案*/
    Boolean bacTestUseDefaultWorkFlow(LabReqMain reqMain, LabMaininfo labMaininfo);

    /*微生物检验采用默认方案-默认检验目的*/
    Boolean bacTestUseDefaultWorkFlowWithPurpose(LabReqMain reqMain, LabMaininfo labMaininfo);

    /*更新方案流程三个联合主键*/
    Boolean bacTestUpdateWorkFlow(LabReqMain reqMain, LabMaininfo labMaininfo);

    /*更新方案流程三个联合主键,已走签收后扫码上机*/
    Boolean bacTestUpdateWorkFlowV1(LabReqMain reqMain, LabMaininfo labMaininfo);

    /*微生物接收时创建申请*/
    Result bacCreateReqMain(LabReqMain reqMain);

    /*微生物接收时更新申请*/
    Result bacUpdateReqMain(LabReqMain reqMain);

    /*微生物接收时更新申请并重新计算应用方案、培养基*/
    Result bacUpdateReqMainWithReset(LabReqMain reqMain);

    /*微生物签收:获取申请列表*/
    Result findLabReqMainListForBacReception(LabReqMainReceptionParam input);

    /*微生物签收:加载首选方案*/
    Result findDefaultWkflwForBacReception(LabReqMainReceptionParam input);

    /*微生物签收:切换首选方案*/
    Result changeDefaultWkflwForBacReception(LabReqMain reqMain);

    /*微生物签收:加载备选方案*/
    Result findSecondWkflwForBacReception(LabReqMainReceptionParam input);

    /*微生物签收:切换备选方案*/
    Result changeSecondWkflwForBacReception(LabReqMainChangeWkflwParam input);

    Result addReqMain(LabReqMain reqMain);

    Result findReqMainList(LabReqMainDto param);

    Result updateReqMain(LabReqMain reqMain);

    Result deleteReqMainById(LabReqMain reqMain);

    Result batchReqMainApprove(LabReqMainDto dto);

    Result cancelReqMainApprove(LabReqMainDto dto);

    Result updateReqMainAndDetail(LabReqMain reqMain);

    Result batchReqReportPublish(LabReqMainDto dto);

    /*验证TAT监控*/
    Result validateTatRules(LabReqMainValidateTatRule input);

    /*申请闭环展示*/
    Result findLabReqMainClosedLoopInfo(String reqNo);

    /*申请闭环展示*/
    Result findLabReqMainTatInfo(String reqNo);

    /*作废标本*/
    Result cancelReqMain(String reqNo) throws JsonProcessingException;

    Result findLabReqMainPageListBySample(LabMaininfoPageDto maininfoPageDto);

    Result addBatchReqMainAndDetail(LabReqMain reqMain);

    Result findReqMainAndDetail(LabReqMainDto param);

    Result deleteBacReqReception(LabReqMain reqMain);

    Result barcodeReprint(List<String> ids);
}
